package com.gf.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

/**
 * Description: 工作流数据源配置<br/>
 *
 * @author liulonglong<br       />;
 * @taskId <br/>
 * @Date 2019/8/15 16:30
 * @Version 1.0
 */
@ConfigurationProperties(prefix = "spring.datasource")
public class ActivitiDatasourceConfig {

    private String url;

    private String username;

    private String password;

    @Bean
    public DataSource database() {
        return DataSourceBuilder.create()
                .url(url)
                .username(username)
                .password(password)
                .driverClassName("com.mysql.jdbc.Driver")
                .build();
    }
}
